package com.rainyun.rc.ioc;

import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Map;

/**IOC枚举项信息*/
public class BindInfo<T> {

	String key;
	Class<? extends T> bindClazz;
	T obj;
	
	Map<Field,String> referFields = new HashMap<>();
	Map<String, Field> referedFields = new HashMap<>();
	Map<Class<?>,Field> referedStaticFields = new HashMap<>();
	
	public BindInfo(String key) {
		this.key = key;
	}
	/**获取键*/
	public String getKey() {
		return key;
	}
	/**获取绑定实体类*/
	public Class<? extends T> getBindClazz() {
		return bindClazz;
	}
	/**设置绑定实体类*/
	public void setBindClazz(Class<?> bindClazz) {
		this.bindClazz = (Class<? extends T>) bindClazz;
	}

	/**获取枚举对应对象*/
	public T getObj() {
		return obj;
	}
	/**设置枚举对应对象*/
	public void setObj(Object obj) {
		this.obj = (T) obj;
	}
	/**获取被引用字段*/
	public Map<String,Field> getReferedFields() {
		return referedFields;
	}
	/**获取被引用静态字段集*/
	public Map<Class<?>, Field> getReferedStaticFields() {
		return referedStaticFields;
	}
	/**获取自身类字段引用的枚举*/
	public Map<Field,String> getReferFields() {
		return referFields;
	}

}
